package com.devin.converter;

import com.devin.utils.DateUtils;
import org.springframework.core.convert.converter.Converter;

import java.text.ParseException;
import java.util.Date;

public class ToDateConverter implements Converter<String, Date> {
    @Override
    public Date convert(String s) {
        Date date = null;
        try {
            date = DateUtils.toDate(s, "yyyy年MM月dd日");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;

    }
}
